<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.org/schema/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" template="layout/template.xhtml">

	<ui:define name="body">
		<h:form id="meetingRoomBookingSearch">
			<p:panel header="预约检索">

				<table>
					<tbody>
						<tr>
							<td></td>
							<td><p:message for="mrType" /></td>
						</tr>
						<tr>
							<td><p:outputLabel for="mrType">会议室类型</p:outputLabel></td>
							<td><h:inputText id="mrType"
									value="#{meetingRoomBooking.meetingRoom.mrType}" /></td>
						</tr>
						<tr>
							<td></td>
							<td><p:message for="mrName" /></td>
						</tr>
						<tr>
							<td><p:outputLabel for="mrName">会议室名称</p:outputLabel></td>
							<td><h:inputText id="mrName"
									value="#{meetingRoomBooking.meetingRoom.mrName}" /></td>
						</tr>
						<tr>
							<td></td>
							<td><p:message for="meetingStartTime" /></td>
						</tr>
						<tr>
							<td><p:outputLabel for="meetingStartTime">预约开始时间</p:outputLabel></td>
							<td><rich:calendar id="meetingStartTime" required="true"
									value="#{meetingRoomBooking.meetingStartTime}"
									datePattern="yyyy/MM/dd HH:mm" timeZone="#{meetingRoomBookingListAction.timeZone}" /></td>
						</tr>
						<tr>
							<td></td>
							<td><p:message for="meetingEndTime" /></td>
						</tr>
						<tr>
                            <td><p:outputLabel for="meetingEndTime">预约结束时间</p:outputLabel></td>
                            <td><rich:calendar id="meetingEndTime" required="true"
                                    value="#{meetingRoomBooking.meetingEndTime}"
                                    datePattern="yyyy/MM/dd HH:mm" timeZone="#{meetingRoomBookingListAction.timeZone}" /></td>
                        </tr>
                        <tr>
                            <td valign="bottom"><h:outputText value="*" style="color:balck;" /> required fields</td>
                            <td><p:spacer height="25"/></td>
                        </tr>
					</tbody>
				</table>
			</p:panel>

			<h:commandButton id="bookingSearch" value="预约检索"
				action="#{meetingRoomBookingListAction.bookingSearch}" />
			<h:commandButton id="search" value="检索"
				action="#{meetingRoomBookingListAction.search}" />
			<s:button id="reset" value="Reset" includePageParams="false" />
            <s:button value="返回" action="cancel" />
		</h:form>

        <h:form id="meetingRoomBookingList" rendered="#{!param['isBookingSearch']}">
            <p:panel header="预约信息检索结果">
                <p:dataTable var="_meetingRoomBooking"
                    value="#{meetingRoomBookings}" id="_meetingRoomBookingTable"
                    paginator="true" rows="10" style="width: 600px;"
                    paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                    rowsPerPageTemplate="5,10, 15" rowKey="index">

                    <p:column headerText="ID" style="width: 50px;">
                        <h:outputText value="#{_meetingRoomBooking.mrbId}" />
                    </p:column>
                    <p:column headerText="会议室名称" style="width: 100px;">
                        <h:commandLink value="#{_meetingRoomBooking.meetingRoom.mrName}"
                            action="#{meetingRoomBookingListAction.showDetail}" />
                    </p:column>
                    <p:column headerText="会议开始时间" style="width: 110px;">
                        <h:outputText value="#{_meetingRoomBooking.meetingStartTime}">
                            <f:convertDateTime pattern="yyyy/MM/dd HH:mm" timeZone="CCT" />
                        </h:outputText>
                    </p:column>
                    <p:column headerText="会议结束时间" style="width: 110px;">
                        <h:outputText value="#{_meetingRoomBooking.meetingEndTime}">
                            <f:convertDateTime pattern="yyyy/MM/dd HH:mm" timeZone="CCT" />
                        </h:outputText>
                    </p:column>
                    <p:column headerText="会议主题" style="width: 100px;">
                        <h:outputText value="#{_meetingRoomBooking.meetingTitle}" />
                    </p:column>
                    <p:column headerText="预约人" style="width: 50px;">
                        <h:outputText value="#{_meetingRoomBooking.bookingUserId}" />
                    </p:column>
                   <!--  
					<p:column headerText="操作" style="width: 40px;text-align:center">
						<h:commandLink value="Edit"
							action="#{meetingRoomBookingListAction.showDetail}" />
					</p:column>
					 -->
				</p:dataTable>

            </p:panel>
        </h:form>



        <h:form id="meetingRoomList" rendered="#{param['isBookingSearch']}">
            <p:panel header="预约会议室检索结果">
                <p:dataTable var="_meetingRoom"
                    value="#{meetingRooms}" id="_meetingRoomTable"
                    paginator="true" rows="10" style="width: 200px;"
                    paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                    rowsPerPageTemplate="5,10, 15" rowKey="index">
                    <p:column headerText="ID" style="width: 50px;">
                        <h:outputText value="#{_meetingRoom.mrId}" />
                    </p:column>
					<p:column headerText="会议室名称" style="width: 150px;">
						<s:link value="#{_meetingRoom.mrName}"
							view="/meetingRoomBookingEdit.xhtml" propagation="begin">
							<f:param name="mrId" value="#{_meetingRoom.mrId}" />
						</s:link>
					</p:column>

				</p:dataTable>

            </p:panel>

        </h:form>

	</ui:define>

</ui:composition>
